﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZF.BLL;
using ZF.BLL.Page;
using GCELibrary.Current;

namespace ZF.WS.news
{
    public partial class bcastr :PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            using (var dc = SiteInfo.CreateDBDataContext())
            {


               var t1= @"<?xml version='1.0' encoding='utf-8'?>
                    <slider>
                   {0}
                    </slider>";

               var t2 = @"<item imageurl='/photo/news/{0}' href='/news/index.aspx?id={1}' title='{2}'></item>";

               var html = "";


               var list=dc.I_News.Where(p => p.Type == "特别关注" && p.IsV==true).OrderByDescending(p => p.NewsId).Take(12)
                            .ToList();
               list.ForEach(p =>
                   {
                       html += string.Format(t2, p.Photo.Replace(";", ""), p.NewsId, p.Title);
                   });

               Response.Write(string.Format(t1, html));
               Response.End();
                 

            }
        }
    }
}
